// praxis/services/sensor_manager.h
#pragma once

#include <praxis/praxis_export.h>

#include <memory>
#include <nlohmann/json.hpp>
#include <string>
#include <unordered_map>

namespace praxis {
class ISensor;

class PRAXIS_API CSensorManager {
 public:
  explicit CSensorManager(const nlohmann::json& config);
  ~CSensorManager();

  CSensorManager(const CSensorManager&) = delete;
  CSensorManager& operator=(const CSensorManager&) = delete;

  std::shared_ptr<ISensor> GetSensor(const std::string& name);
  const std::unordered_map<std::string, std::shared_ptr<ISensor>>&
  GetAllSensors() const;
  const nlohmann::json& GetSensorConfig(const std::string& name) const;

  void UpdateAllSensors();
  const nlohmann::json& GetCurrentValues();

 private:
  struct Impl;
  std::unique_ptr<Impl> impl_;
};
}  // namespace praxis
